Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additional JVM arguments can be specified through the
JAVA_TOOL_OPTIONS
environment variable. For languageservers to be able to work with Lombok, the JVM must load
the
lombok.jar
. Lombok is packaged in nixpkgs, which providesboth a
java
wrapper for use with Lombok, as well as the JARitself on its own. This is what we care about. We can dynamically
make this accessible through the addition, whose path points to
the JAR that the Lombok package provides. Lombok is very useful, but can
be annoying to set-up when not working with a heavy IDE that abstracts
it all away. This eliminates the concern altogether, rather than having
to manually configure it for something like Neovim. It should just work
now.
It's a very lightweight addition that won't bloat. If the user
already is using the environment variable, the Lombok invocation will be
prepended rather than overriding the variable, hence why it is set in
shellHook
, rather than simply asJAVA_TOOL_OPTIONS = "-javaagent:${pkgs.lombok}/share/java/lombok.jar"
.The
lombok
package also has a gcroot tied to it, preventing it frombeing garbage collected, just like everything else in
packages
.